package com.study.spmongodb.book.wwj.char05;

import java.util.List;
import java.util.concurrent.TimeoutException;

/**
 * @author MI
 * @version 1.0
 * @date 2020/11/25 21:04
 */
public interface Lock {
    void lock() throws InterruptedException;

    void lock(long mills) throws InterruptedException, TimeoutException;

    void unlock();

    /**
     * 获取当前有哪些线程被阻塞
     *
     * @return
     */
    List<Thread> getBlockedThreads();
}
